# -*- coding:utf-8 -*-
# 题目：
# 用列表推导式找出下面列表当中不包含“e”的放到新列表中

# list1 = ["hello","python","love","you"]
# 推导式方法：
# list1 = ["hello", "python", "love", "you"]
# list2 = [data for data in list1 if "e" not in data]
# print(list2)

# for循环法：
# list1 = ["hello", "python", "love", "you"]
# list2 = []
# for data in list1:
#     if "e" not in data:
#         list2.append(data)
# print(list2)


dict_data = {
    "current": 1,
    "limit": 20,
    "count": 408092,
    "list": [
        {
            "id": 1380960,
            "prodName": "西芹",
            "prodCat": "蔬菜",
            "place": "辽冀",
            "pubDate": "2022-12-28 00:00:00",
        },
        {
            "id": 1380959,
            "prodName": "菠菜",
            "prodCat": "蔬菜",
            "place": "冀鲁",
            "pubDate": "2022-12-28 00:00:00",

        },
        {
            "id": 1380958,
            "prodName": "莴笋",
            "prodCat": "蔬菜",
            "place": "鲁",
            "pubDate": "2022-12-28 00:00:00",
        },
        {
            "id": 1380957,
            "prodName": "团生菜",
            "prodCat": "蔬菜",
            "place": "冀京云",
            "pubDate": "2022-12-28 00:00:00",

        },
        {
            "id": 1380956,
            "prodName": "散叶生菜",
            "prodCat": "蔬菜",
            "place": "冀辽",
            "pubDate": "2022-12-28 00:00:00",

        },
        {
            "id": 1380955,
            "prodName": "罗马生菜",
            "prodCat": "蔬菜",
            "place": "冀云",
            "pubDate": "2022-12-28 00:00:00",

        },
        {
            "id": 1380954,
            "prodName": "油菜",
            "prodCat": "蔬菜",
            "place": "鲁京川皖",
            "pubDate": "2022-12-28 00:00:00",
        },
        {
            "id": 1380953,
            "prodName": "香菜",
            "prodCat": "蔬菜",
            "place": "冀",
            "pubDate": "2022-12-28 00:00:00",

        },
        {
            "id": 1380952,
            "prodName": "茴香",
            "prodCat": "蔬菜",
            "place": "冀",
            "pubDate": "2022-12-28 00:00:00",
        },
        {
            "id": 1380951,
            "prodName": "韭菜",
            "prodCat": "蔬菜",
            "place": "冀粤",
            "pubDate": "2022-12-28 00:00:00",

        },
        {
            "id": 1380950,
            "prodName": "苦菊",
            "prodCat": "蔬菜",
            "place": "冀辽",
            "pubDate": "2022-12-28 00:00:00",
        },
        {
            "id": 1380949,
            "prodName": "油麦菜",
            "prodCat": "蔬菜",
            "place": "冀辽云",
            "pubDate": "2022-12-28 00:00:00",
        },
        {
            "id": 1380948,
            "prodName": "散菜花",
            "prodCat": "蔬菜",
            "place": "豫鲁陕云",
            "pubDate": "2022-12-28 00:00:00",
        },
        {
            "id": 1380947,
            "prodName": "绿菜花",
            "prodCat": "蔬菜",
            "place": "苏鄂浙",
            "pubDate": "2022-12-28 00:00:00",

        }
    ]
}

data_list = dict_data["list"]     # 拿到key是list的值
# print(data_list)
for data in data_list:            # 遍历列表
    id = data["id"]               # 拿到键为id的值
    prodName = data["prodName"]
    prodCat = data["prodCat"]
    place = data["place"]
    pubDate = data["pubDate"]
    print(id, prodName, prodCat, place, pubDate)
